package com.jian.mygame;

import android.app.Activity;
import android.content.Intent;
import android.media.AudioManager;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainMenu extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        //Window features must be set before setContentView() is called       
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        updateFullscreenStatus(true);
        
        setContentView(R.layout.main);
        
        //Set to change Media Volume during this activity instead of Ringer Volume
        setVolumeControlStream(AudioManager.STREAM_MUSIC);
        
        Button StartGameButton = (Button)findViewById(R.id.StartGame);
        StartGameButton.setOnClickListener(new OnClickListener() {
        	
        	public void onClick(View v) {
        		Intent StartGameIntent = new Intent(MainMenu.this,MyGame.class);
        		startActivity(StartGameIntent);
        	}
        });
        /*
        Button HelpButton = (Button)findViewById(R.id.Help);
        HelpButton.setOnClickListener(new OnClickListener() {
        	
        	public void onClick(View v) {
        		//Intent HelpIntent = new Intent(MainMenu.this,Help.class);
        		//startActivity(HelpIntent);
        	}
        });
        
        Button OptionsButton = (Button)findViewById(R.id.Options);
        OptionsButton.setOnClickListener(new OnClickListener() {
        	
        	public void onClick(View v) {
        		//Intent OptionsIntent = new Intent(MainMenu.this,Options.class);
        		//startActivity(OptionsIntent);
        	}
        });
        
        Button CreditsButton = (Button)findViewById(R.id.Credits);
        CreditsButton.setOnClickListener(new OnClickListener() {
        	
        	public void onClick(View v) {
        		//Intent CreditsIntent= new Intent(MainMenu.this,Credits.class);
        		//startActivity(CreditsIntent);
        	}
        });
        */
    }
    
    private void updateFullscreenStatus(boolean bUseFullscreen)
    {   
       if(bUseFullscreen)
       {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
            getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
        }
        else
        {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
            getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }

        //m_contentView.requestLayout();
    }
    
}